﻿using System;
using Solution.Application.Utils;

namespace Solution.Application.Dtos
{
    public class EventInput<T>
    {
        /// <summary>
        /// 用于幂等
        /// </summary>
        public string EventId { get; set; } = Guid.NewGuid().ToString();

        public T Data { get; set; } = default;

        /// <summary>
        /// 用于保证消息顺序性，当前消息版本号大于上一消息版本号时才进行业务逻辑处理
        /// </summary>
        public long? Version { get; set; } = DatetimeHelper.ToUnixTimestampBySeconds(DateTime.UtcNow);
    }
}